// Copyright 2017-2020 Parity Technologies (UK) Ltd.
// This file is part of Polkadot.

// Polkadot is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.

// Polkadot is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with Polkadot.  If not, see <http://www.gnu.org/licenses/>.
//! Autogenerated weights for pallet_democracy
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 3.0.0
//! DATE: 2021-04-27, STEPS: `[50, ]`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kusama-dev"), DB CACHE: 128

// Executed Command:
// target/release/polkadot
// benchmark
// --chain=kusama-dev
// --steps=50
// --repeat=20
// --pallet=pallet_democracy
// --extrinsic=*
// --execution=wasm
// --wasm-execution=compiled
// --heap-pages=4096
// --header=./file_header.txt
// --output=./runtime/kusama/src/weights/

#![allow(unused_parens)]
#![allow(unused_imports)]

use frame_support::{traits::Get, weights::Weight};
use sp_std::marker::PhantomData;

/// Weight functions for pallet_democracy.
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> pallet_democracy::WeightInfo for WeightInfo<T> {
    fn propose() -> Weight {
        (57_956_000 as Weight)
            .saturating_add(T::DbWeight::get().reads(3 as Weight))
            .saturating_add(T::DbWeight::get().writes(3 as Weight))
    }
    fn second(s: u32) -> Weight {
        (38_619_000 as Weight)
            // Standard Error: 0
            .saturating_add((220_000 as Weight).saturating_mul(s as Weight))
            .saturating_add(T::DbWeight::get().reads(1 as Weight))
            .saturating_add(T::DbWeight::get().writes(1 as Weight))
    }
    fn vote_new(r: u32) -> Weight {
        (43_587_000 as Weight)
            // Standard Error: 0
            .saturating_add((281_000 as Weight).saturating_mul(r as Weight))
            .saturating_add(T::DbWeight::get().reads(3 as Weight))
            .saturating_add(T::DbWeight::get().writes(3 as Weight))
    }
    fn vote_existing(r: u32) -> Weight {
        (43_422_000 as Weight)
            // Standard Error: 0
            .saturating_add((281_000 as Weight).saturating_mul(r as Weight))
            .saturating_add(T::DbWeight::get().reads(3 as Weight))
            .saturating_add(T::DbWeight::get().writes(3 as Weight))
    }
    fn emergency_cancel() -> Weight {
        (27_034_000 as Weight)
            .saturating_add(T::DbWeight::get().reads(2 as Weight))
            .saturating_add(T::DbWeight::get().writes(2 as Weight))
    }
    fn blacklist(p: u32) -> Weight {
        (77_235_000 as Weight)
            // Standard Error: 4_000
            .saturating_add((705_000 as Weight).saturating_mul(p as Weight))
            .saturating_add(T::DbWeight::get().reads(5 as Weight))
            .saturating_add(T::DbWeight::get().writes(6 as Weight))
    }
    fn external_propose(v: u32) -> Weight {
        (12_699_000 as Weight)
            // Standard Error: 0
            .saturating_add((113_000 as Weight).saturating_mul(v as Weight))
            .saturating_add(T::DbWeight::get().reads(2 as Weight))
            .saturating_add(T::DbWeight::get().writes(1 as Weight))
    }
    fn external_propose_majority() -> Weight {
        (2_569_000 as Weight).saturating_add(T::DbWeight::get().writes(1 as Weight))
    }
    fn external_propose_default() -> Weight {
        (2_531_000 as Weight).saturating_add(T::DbWeight::get().writes(1 as Weight))
    }
    fn fast_track() -> Weight {
        (26_505_000 as Weight)
            .saturating_add(T::DbWeight::get().reads(2 as Weight))
            .saturating_add(T::DbWeight::get().writes(3 as Weight))
    }
    fn veto_external(v: u32) -> Weight {
        (27_294_000 as Weight)
            // Standard Error: 0
            .saturating_add((213_000 as Weight).saturating_mul(v as Weight))
            .saturating_add(T::DbWeight::get().reads(2 as Weight))
            .saturating_add(T::DbWeight::get().writes(2 as Weight))
    }
    fn cancel_proposal(p: u32) -> Weight {
        (51_914_000 as Weight)
            // Standard Error: 0
            .saturating_add((682_000 as Weight).saturating_mul(p as Weight))
            .saturating_add(T::DbWeight::get().reads(3 as Weight))
            .saturating_add(T::DbWeight::get().writes(3 as Weight))
    }
    fn cancel_referendum() -> Weight {
        (15_731_000 as Weight).saturating_add(T::DbWeight::get().writes(1 as Weight))
    }
    fn cancel_queued(r: u32) -> Weight {
        (27_991_000 as Weight)
            // Standard Error: 9_000
            .saturating_add((3_838_000 as Weight).saturating_mul(r as Weight))
            .saturating_add(T::DbWeight::get().reads(2 as Weight))
            .saturating_add(T::DbWeight::get().writes(2 as Weight))
    }
    fn on_initialize_base(r: u32) -> Weight {
        (7_215_000 as Weight)
            // Standard Error: 4_000
            .saturating_add((5_247_000 as Weight).saturating_mul(r as Weight))
            .saturating_add(T::DbWeight::get().reads(5 as Weight))
            .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(r as Weight)))
    }
    fn delegate(r: u32) -> Weight {
        (55_704_000 as Weight)
            // Standard Error: 4_000
            .saturating_add((7_504_000 as Weight).saturating_mul(r as Weight))
            .saturating_add(T::DbWeight::get().reads(4 as Weight))
            .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(r as Weight)))
            .saturating_add(T::DbWeight::get().writes(4 as Weight))
            .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(r as Weight)))
    }
    fn undelegate(r: u32) -> Weight {
        (23_489_000 as Weight)
            // Standard Error: 5_000
            .saturating_add((7_534_000 as Weight).saturating_mul(r as Weight))
            .saturating_add(T::DbWeight::get().reads(2 as Weight))
            .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(r as Weight)))
            .saturating_add(T::DbWeight::get().writes(2 as Weight))
            .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(r as Weight)))
    }
    fn clear_public_proposals() -> Weight {
        (2_159_000 as Weight).saturating_add(T::DbWeight::get().writes(1 as Weight))
    }
    fn note_preimage(b: u32) -> Weight {
        (41_985_000 as Weight)
            // Standard Error: 0
            .saturating_add((4_000 as Weight).saturating_mul(b as Weight))
            .saturating_add(T::DbWeight::get().reads(1 as Weight))
            .saturating_add(T::DbWeight::get().writes(1 as Weight))
    }
    fn note_imminent_preimage(b: u32) -> Weight {
        (26_640_000 as Weight)
            // Standard Error: 0
            .saturating_add((3_000 as Weight).saturating_mul(b as Weight))
            .saturating_add(T::DbWeight::get().reads(1 as Weight))
            .saturating_add(T::DbWeight::get().writes(1 as Weight))
    }
    fn reap_preimage(b: u32) -> Weight {
        (37_613_000 as Weight)
            // Standard Error: 0
            .saturating_add((3_000 as Weight).saturating_mul(b as Weight))
            .saturating_add(T::DbWeight::get().reads(2 as Weight))
            .saturating_add(T::DbWeight::get().writes(1 as Weight))
    }
    fn unlock_remove(r: u32) -> Weight {
        (38_193_000 as Weight)
            // Standard Error: 0
            .saturating_add((56_000 as Weight).saturating_mul(r as Weight))
            .saturating_add(T::DbWeight::get().reads(3 as Weight))
            .saturating_add(T::DbWeight::get().writes(3 as Weight))
    }
    fn unlock_set(r: u32) -> Weight {
        (34_693_000 as Weight)
            // Standard Error: 0
            .saturating_add((267_000 as Weight).saturating_mul(r as Weight))
            .saturating_add(T::DbWeight::get().reads(3 as Weight))
            .saturating_add(T::DbWeight::get().writes(3 as Weight))
    }
    fn remove_vote(r: u32) -> Weight {
        (18_935_000 as Weight)
            // Standard Error: 0
            .saturating_add((254_000 as Weight).saturating_mul(r as Weight))
            .saturating_add(T::DbWeight::get().reads(2 as Weight))
            .saturating_add(T::DbWeight::get().writes(2 as Weight))
    }
    fn remove_other_vote(r: u32) -> Weight {
        (19_265_000 as Weight)
            // Standard Error: 0
            .saturating_add((252_000 as Weight).saturating_mul(r as Weight))
            .saturating_add(T::DbWeight::get().reads(2 as Weight))
            .saturating_add(T::DbWeight::get().writes(2 as Weight))
    }
}
